import http from '@/utils/http'

/***
 * @name 获取购物车列表
 */
export const getCartListApi = (data) => {
    return http({
        url: 'shop/cart/cart_list',
        method: 'POST',
        data
    })
}

/***
 * @name 加入购物车
 * @param data.sku 商品规格编码
 * @param data.num
 * @param data.shop_id
 */
export const addToCartApi = (data) => {
    return http({
        url: 'shop/cart/add',
        method: 'POST',
        data
    })
}

/***
 * @name 购物车删除
 * @param data.sku 商品规格编码
 */
export const cartDelGoodsApi = (data) => {
    return http({
        url: 'shop/cart/del',
        method: 'POST',
        data
    })
}
/***
 * @name 购物车修改商品数量
 * @param data.sku 商品规格编码
 * @param data.num
 */
export const editCartGoodsApi = (data) => {
    return http({
        url: 'shop/cart/edit',
        method: 'POST',
        data
    })
}